This simple calculator was written for programmers. The function controls are modeled after the C syntax and the RPN logic is modeled after Hewlett Packard calculators.
Binary Calculator uses the Appearance Manager (if available) so it looks a little different under MacOS 8 than it does under System 7. If the Appearance Manager is present the calculator also offers a help dialog. If you don't see a help button in the calculator window then you should keep this Read Me file around for reference.
The Stack
HP Calculators use a four-element stack. The stack is made up of X, Y, Z, and T values. The X value is the main working value. Certain operations (shift left/right, increment/decrement, not, and clear) work only on the X value. When you press Enter the stack is rolled up and the X value is recopied into the X element. Swap switches the values of the X and Y elements.
Number Entry
The left part of the calculator is for number entry. The top half represents the Y element of the stack, a number already entered. The bottom half represents the X element and is the place where new numbers are entered.
There are eight places where you can enter digits or characters: long, UInt32, Fixed, Octal, Hi-Double, Fract, Hex, and OSType. These types should be familiar to Macintosh programmers. Except for Hi-Double all of them are 32-bit values. Hi-Double means the high 32 bits of an 8-byte double. These are the most significant bits in a double so it is interesting to see how floating point numbers are represented. (Note that the lower half of the double is always left as zero so there is a loss of accuracy.) Whichever edit field is active controls the numeric format of the stack.
The Bits Dispay
The bits display lets you see exactly how a number is represented in binary form. You can click on the bottom bit display to turn bits on and off. Bits may be shifted left and right or incremented and decremented by using the arrow keys.
Keyboard Shortcuts
Most of the buttons can be operated by typing their label characters without using command keys.
To enter a neagtive number use the minus key that is on the main part of the keyboard. To activate the subtract button use the minus key on the numeric keypad.
The left and right arrow keys shift the value left (<<) and right (>>).
The up and down arrow keys increment (++) or decrement (--) the bits of the value.
The page up and page down keys roll the stack up or down.
Version History
v1.0.3 Fixed some negative number issues and removed an unnecessary activate/deactivate.